<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost:8080/Website/" />
<title>MakeReservationSC1TC5</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">MakeReservationSC1TC5</td></tr>
</thead><tbody>
<!--Created by Steven Chow-->
<!--Use Case: Make Reservation-->
<!--Scenario 1: Successful Reservation-->
<!--Test Case 5: User can reserve for connecting flights-->
<!---->
<!--Go to Website-->
<tr>
	<td>open</td>
	<td>/Website/</td>
	<td></td>
</tr>
<!--Login to Account-->
<tr>
	<td>clickAndWait</td>
	<td>css=div.tile.bg-color-red &gt; div.tile-content.icon</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>name=username</td>
	<td>ReserveUser4</td>
</tr>
<tr>
	<td>type</td>
	<td>name=password</td>
	<td>pass</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=input[type=&quot;submit&quot;]</td>
	<td></td>
</tr>
<!--Are we in the Customer portal?-->
<tr>
	<td>assertTitle</td>
	<td>Customer Portal</td>
	<td></td>
</tr>
<!--Search for a Flight-->
<tr>
	<td>assertElementPresent</td>
	<td>css=div.tile-content.icon</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=div.tile-content.icon</td>
	<td></td>
</tr>
<!--Are we in the Search Flight Page?-->
<tr>
	<td>assertTitle</td>
	<td>Search Flight</td>
	<td></td>
</tr>
<!--Search Without Filters-->
<tr>
	<td>clickAndWait</td>
	<td>css=input[type=&quot;submit&quot;]</td>
	<td></td>
</tr>
<!--Is our Connecting Flight There?-->
<tr>
	<td>assertText</td>
	<td>//html/body/div/div[2]/div/div/div/div/div[2]/form[2]/table/tbody/tr/td/label/span</td>
	<td>1002/1004</td>
</tr>
<!--Click on the connecting Flight-->
<tr>
	<td>click</td>
	<td>xpath=(//input[@name='r1'])[6]</td>
	<td></td>
</tr>
<!--Is the Reserve Button there?-->
<tr>
	<td>assertElementPresent</td>
	<td>css=html body.modern-ui div.page div.page-region div.page-region-content div.row div.span10 div.span10 div.page form div input</td>
	<td></td>
</tr>
<!--Let's make a reservation-->
<tr>
	<td>clickAndWait</td>
	<td>xpath=(//input[@value='Reserve'])[2]</td>
	<td></td>
</tr>
<!--Are we in the Reservation page?-->
<tr>
	<td>assertTitle</td>
	<td>Reservation</td>
	<td></td>
</tr>
<!--Fill out information-->
<tr>
	<td>type</td>
	<td>name=firstName</td>
	<td>Blue</td>
</tr>
<tr>
	<td>type</td>
	<td>name=lastName</td>
	<td>Bear</td>
</tr>
<tr>
	<td>type</td>
	<td>name=seatID1</td>
	<td>A11</td>
</tr>
<tr>
	<td>type</td>
	<td>name=seatID2</td>
	<td>E18</td>
</tr>
<tr>
	<td>select</td>
	<td>name=mealOption1</td>
	<td>label=Beef</td>
</tr>
<tr>
	<td>select</td>
	<td>name=mealOption2</td>
	<td>label=Beef</td>
</tr>
<!--Check if the Submit button is there-->
<tr>
	<td>assertElementPresent</td>
	<td>css=html body.modern-ui div.page div.page-region div.page-region-content div.page-control form input</td>
	<td></td>
</tr>
<!--Let's Submit-->
<tr>
	<td>clickAndWait</td>
	<td>css=input[type=&quot;submit&quot;]</td>
	<td></td>
</tr>
<!--Are we in the Payment Page for connecting flights-->
<tr>
	<td>assertTitle</td>
	<td>Payment</td>
	<td></td>
</tr>
<!--Make the payments-->
<tr>
	<td>type</td>
	<td>name=credit1</td>
	<td>200</td>
</tr>
<tr>
	<td>type</td>
	<td>name=credit2</td>
	<td>100</td>
</tr>
<tr>
	<td>type</td>
	<td>name=point2</td>
	<td>50</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=input[type=&quot;submit&quot;]</td>
	<td></td>
</tr>
<!--Check if there is a message-->
<tr>
	<td>assertText</td>
	<td>//html/body/div/div[2]/div/div/div/div/h4</td>
	<td>2 new reservations added!</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=div.tile.bg-color-blue &gt; div.tile-content.icon &gt; img</td>
	<td></td>
</tr>
<!--Let's check if we have our 2 reservations added-->
<tr>
	<td>assertTextPresent</td>
	<td>Vancouver</td>
	<td></td>
</tr>
<tr>
	<td>assertTextPresent</td>
	<td>Edmonton</td>
	<td></td>
</tr>
<tr>
	<td>assertText</td>
	<td>//html/body/div/div[2]/div/div/div/div/form/table/tbody/tr/td[6]</td>
	<td>200.0</td>
</tr>
<tr>
	<td>assertText</td>
	<td>//html/body/div/div[2]/div/div/div/div/form/table/tbody/tr[2]/td[6]</td>
	<td>150.0</td>
</tr>
</tbody></table>
</body>
</html>
